<html>
    <script>
      new Promise((resolve,reject)=>{
        setTimeout(() => {
                reject("err data")
        }, 1000);
      }).then(data=>{
            console.log('data')
      },error=>{
        console.log('error')
      })
    </script>
    
   
</html>